home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / helpPanel.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.1 KB  |  160 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc
  18. createHelpPanel (string $whichPanel)
  19. //
  20. //  Description:
  21. //        Define the editors that are used in this panel.  No
  22. //        controls (widgets) are created at this point.
  23. //
  24. {
  25.     //  create unique names for editors based on panel name
  26.     //
  27.     string $helpWidget = ($whichPanel + "HelpWidget");
  28.  
  29. }
  30.  
  31. global proc
  32. addHelpPanel (string $whichPanel)
  33. //
  34. //  Description:
  35. //        Add the panel to a layout.
  36. //        Parent the editors to that layout and create any other
  37. //        controls (widgets) required.
  38. //
  39. {
  40.     string $helpWidget = ($whichPanel + "HelpWidget");
  41.  
  42.     // Make sure that there is no template active
  43.     setUITemplate -pushTemplate NONE;
  44.  
  45.     // Define the standard panel
  46.     //
  47.     string $widgetList[];
  48.  
  49.     $widgetList[2] = `scriptedPanel -query -control $whichPanel`;
  50.     $widgetList[0] = `formLayout`;
  51.     $widgetList[3] = `frameLayout -visible true -borderVisible false
  52.             -labelVisible false -collapsable false -collapse true
  53.             -borderStyle "in"`;
  54.     $widgetList[4] = `formLayout -visible true`;
  55.     setParent $widgetList[0];
  56.     $widgetList[5] = `formLayout -visible true`;
  57.  
  58.     formLayout -edit
  59.         -attachForm $widgetList[3] top 0 
  60.         -attachForm $widgetList[3] right 0
  61.         -attachForm $widgetList[3] left 0
  62.  
  63.         -attachControl $widgetList[5] top 0 $widgetList[3]
  64.         -attachForm $widgetList[5] bottom 0
  65.         -attachForm $widgetList[5] right 0
  66.         -attachForm $widgetList[5] left 0
  67.         $widgetList[0];
  68.  
  69.     setParent $widgetList[0];
  70.  
  71.     //    menuBarLayout is turned on for this editor -
  72.     //    create the top level menus
  73.     //
  74.     setParent $widgetList[2];
  75.  
  76.     //    Add support for the Context Sensitive Help Menu.
  77.     //
  78. //    addContextHelpProc $whichPanel "buildGraphEditorContextHelpItems";
  79.  
  80.     // Attach tools to the tool form
  81.     //
  82.     setParent $widgetList[4];
  83.         toolButton 
  84.             -doubleClickCommand toolPropertyWindow
  85.             -collection toolCluster 
  86.             -tool directKeySuperContext 
  87.             -style "iconOnly"
  88.             -image1 "directKeySmall.xpm"
  89.             -width 26 -height 26
  90.             directKeyTool;
  91.  
  92.         //    Layout the toolbar
  93.         //
  94.         formLayout -edit
  95.             -attachForm directKeyTool "left" 0     
  96.  
  97.             $widgetList[4];
  98.  
  99.     // Parent the editors to the editor layout
  100.     //
  101.     setParent $widgetList[5];
  102.     htmlWidget $helpWidget;
  103.     formLayout -edit
  104.         -attachForm $helpWidget top 0 
  105.         -attachForm $helpWidget right 0
  106.         -attachForm $helpWidget left 0
  107.         -attachForm $helpWidget bottom 0
  108.         $widgetList[5];
  109.  
  110.     // Attach menus to the graph editor and the
  111.     // outliner editor.  
  112.     //
  113. //    GraphEditorMenu $graphEd $outlineEd $widgetList;
  114.  
  115.     setParent -top;
  116.  
  117.     setUITemplate -popTemplate;
  118. }
  119.  
  120. global proc
  121. removeHelpPanel (string $whichPanel)
  122. //
  123. //  Description:
  124. //        Remove the panel from a layout.
  125. //        Delete controls.
  126. //
  127. {
  128.     string $helpWidget = ($whichPanel + "HelpWidget");
  129.  
  130. }
  131.  
  132. global proc
  133. deleteHelpPanel (string $whichPanel)
  134. //
  135. //  Description:
  136. //        This proc will delete the contents of the panel, but not
  137. //        the panel itself.
  138. //
  139. //  Note:
  140. //        We only need to delete editors here.  Other UI will be taken care of
  141. //        by the remove proc.
  142. //
  143. {
  144.     string $helpWidget = ($whichPanel + "HelpWidget");
  145.  
  146. }
  147.  
  148. global proc string
  149. saveStateHelpPanel (string $whichPanel)
  150. //
  151. //  Description:
  152. //        This proc returns a string that when executed will restore the
  153. //        current state of the panel elements.
  154. //
  155. {
  156.     string $helpWidget = ($whichPanel + "HelpWidget");
  157.  
  158.     return ("");
  159. }
  160.